package com.unknowpupil.design.cor;

/**
 * @Description: <p>
 *  主任
 * </p>
 * @Author: <a> w10g </a>
 * @CreateDate: Create in 2020/4/28 12:00
 * @Classname: Director
 * @Version: 1.0
 */
public class Manager extends Leader{

    public Manager(String name) {
        super(name);
    }

    @Override
    public void handleRequest(LeaveRequest request) {
        if(request.getLeaveDays()>=3&&request.getLeaveDays()<10){
            System.out.println("经理："+this.name+" 审批通过");
            System.out.println("员工："+request.getEmpName()+ "请假" +request.getLeaveDays() +"天"+"理由："+request.getReason());
        }else {
            //下家是谁，构建的时候传
            if(this.nextLeader!=null){
                this.nextLeader.handleRequest(request);
            }
        }
    }
}
